import random
import random

from mcp.server.fastmcp import FastMCP

# Create server
mcp = FastMCP("Echo Server")


# 1-MCP工具1-数字加和
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    print(f"[MCP工具1-数字加和] add({a}, {b})")
    return a + b


# 2-MCP工具2-随机选定的字符
@mcp.tool()
def get_secret_word() -> str:
    """获取随机单词"""
    print("[MCP工具2-随机选定的字符] get_secret_word()")
    return random.choice(["apple", "banana", "cherry"])


if __name__ == "__main__":
    mcp.run(transport="stdio")
